/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ResultFrame.java
 *
 * Created on 24/11/2009, 00:23:13
 */

package quantizacaovetorial;

/**
 *
 * @author Guto
 */
public class ResultFrame extends javax.swing.JFrame {

    /** Creates new form ResultFrame */
    public ResultFrame() {
        initComponents();
       // setExtendedState(ResultFrame.MAXIMIZED_BOTH);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panelImageOriginal = new javax.swing.JPanel();
        panelImageQuantification = new javax.swing.JPanel();
        labelImageOrignal = new javax.swing.JLabel();
        labelImageQuant = new javax.swing.JLabel();
        painelDictionary = new javax.swing.JPanel();
        bloc1 = new javax.swing.JPanel();
        txtCostQuantification = new javax.swing.JTextField();
        txtMse = new javax.swing.JTextField();
        txtPsnr = new javax.swing.JTextField();
        labelCostQuantification = new javax.swing.JLabel();
        labelMse = new javax.swing.JLabel();
        labelPsnr = new javax.swing.JLabel();
        painelOP = new javax.swing.JPanel();
        txtMulti = new javax.swing.JTextField();
        txtDiv = new javax.swing.JTextField();
        txtComp = new javax.swing.JTextField();
        txtSub = new javax.swing.JTextField();
        txtSum = new javax.swing.JTextField();
        labelSum = new javax.swing.JLabel();
        labelSub = new javax.swing.JLabel();
        labelMulti = new javax.swing.JLabel();
        labelDiv = new javax.swing.JLabel();
        labelComp = new javax.swing.JLabel();
        txtMouse = new javax.swing.JTextField();
        labelPsnr1 = new javax.swing.JLabel();
        txtTimeExecution = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        panelImageOriginal.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 153)));
        panelImageOriginal.setPreferredSize(new java.awt.Dimension(256, 256));

        javax.swing.GroupLayout panelImageOriginalLayout = new javax.swing.GroupLayout(panelImageOriginal);
        panelImageOriginal.setLayout(panelImageOriginalLayout);
        panelImageOriginalLayout.setHorizontalGroup(
            panelImageOriginalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 254, Short.MAX_VALUE)
        );
        panelImageOriginalLayout.setVerticalGroup(
            panelImageOriginalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 254, Short.MAX_VALUE)
        );

        panelImageQuantification.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 153)));
        panelImageQuantification.setPreferredSize(new java.awt.Dimension(256, 256));
        panelImageQuantification.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                panelImageQuantificationMouseMoved(evt);
            }
        });

        javax.swing.GroupLayout panelImageQuantificationLayout = new javax.swing.GroupLayout(panelImageQuantification);
        panelImageQuantification.setLayout(panelImageQuantificationLayout);
        panelImageQuantificationLayout.setHorizontalGroup(
            panelImageQuantificationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 254, Short.MAX_VALUE)
        );
        panelImageQuantificationLayout.setVerticalGroup(
            panelImageQuantificationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 254, Short.MAX_VALUE)
        );

        labelImageOrignal.setForeground(new java.awt.Color(153, 153, 153));
        labelImageOrignal.setText("Imagem Original");

        labelImageQuant.setForeground(new java.awt.Color(153, 153, 153));
        labelImageQuant.setText("Imagem Quantificada");

        painelDictionary.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 153)), "Blocos do Dicionário\n", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(153, 153, 153))); // NOI18N
        painelDictionary.setAutoscrolls(true);

        bloc1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102)));
        bloc1.setForeground(new java.awt.Color(153, 153, 153));
        bloc1.setPreferredSize(new java.awt.Dimension(16, 16));

        javax.swing.GroupLayout bloc1Layout = new javax.swing.GroupLayout(bloc1);
        bloc1.setLayout(bloc1Layout);
        bloc1Layout.setHorizontalGroup(
            bloc1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 14, Short.MAX_VALUE)
        );
        bloc1Layout.setVerticalGroup(
            bloc1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 14, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout painelDictionaryLayout = new javax.swing.GroupLayout(painelDictionary);
        painelDictionary.setLayout(painelDictionaryLayout);
        painelDictionaryLayout.setHorizontalGroup(
            painelDictionaryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelDictionaryLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(bloc1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(865, Short.MAX_VALUE))
        );
        painelDictionaryLayout.setVerticalGroup(
            painelDictionaryLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelDictionaryLayout.createSequentialGroup()
                .addComponent(bloc1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(56, Short.MAX_VALUE))
        );

        txtCostQuantification.setEditable(false);

        txtMse.setEditable(false);

        txtPsnr.setEditable(false);

        labelCostQuantification.setForeground(new java.awt.Color(102, 102, 102));
        labelCostQuantification.setText("Taxa de Quantificação:");

        labelMse.setForeground(new java.awt.Color(102, 102, 102));
        labelMse.setText("MSE:");

        labelPsnr.setForeground(new java.awt.Color(102, 102, 102));
        labelPsnr.setText("PSNR:");

        painelOP.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Quantidade de Operações:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), new java.awt.Color(102, 102, 102))); // NOI18N

        txtMulti.setEditable(false);
        txtMulti.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtMultiActionPerformed(evt);
            }
        });

        txtDiv.setEditable(false);

        txtComp.setEditable(false);

        txtSub.setEditable(false);

        txtSum.setEditable(false);

        labelSum.setForeground(new java.awt.Color(102, 102, 102));
        labelSum.setText("Soma:");

        labelSub.setForeground(new java.awt.Color(102, 102, 102));
        labelSub.setText("Subtração:");

        labelMulti.setForeground(new java.awt.Color(102, 102, 102));
        labelMulti.setText("Multiplicação:");

        labelDiv.setForeground(new java.awt.Color(102, 102, 102));
        labelDiv.setText("Divisão:");

        labelComp.setForeground(new java.awt.Color(102, 102, 102));
        labelComp.setText("Comparação:");

        javax.swing.GroupLayout painelOPLayout = new javax.swing.GroupLayout(painelOP);
        painelOP.setLayout(painelOPLayout);
        painelOPLayout.setHorizontalGroup(
            painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelOPLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(labelSum)
                    .addComponent(labelMulti)
                    .addComponent(labelDiv)
                    .addComponent(labelComp)
                    .addComponent(labelSub))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtComp, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                    .addComponent(txtDiv, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                    .addComponent(txtMulti, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                    .addComponent(txtSub, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)
                    .addComponent(txtSum, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                .addContainerGap())
        );
        painelOPLayout.setVerticalGroup(
            painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelOPLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtSum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelSum))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtSub, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelSub))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtMulti, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelMulti))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtDiv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelDiv))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelOPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtComp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelComp))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        txtMouse.setEditable(false);
        txtMouse.setForeground(new java.awt.Color(102, 102, 102));

        labelPsnr1.setForeground(new java.awt.Color(102, 102, 102));
        labelPsnr1.setText("Tempo de Execusão:");

        txtTimeExecution.setEditable(false);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(111, 111, 111)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(labelCostQuantification)
                            .addComponent(labelMse)
                            .addComponent(labelPsnr)
                            .addComponent(labelPsnr1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(txtTimeExecution, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtPsnr)
                            .addComponent(txtCostQuantification, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtMse, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(75, 75, 75)
                        .addComponent(painelOP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(painelDictionary, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(119, 119, 119)
                                        .addComponent(panelImageOriginal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(153, 153, 153)
                                        .addComponent(panelImageQuantification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                                        .addGap(200, 200, 200)
                                        .addComponent(labelImageOrignal)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(labelImageQuant)
                                        .addGap(69, 69, 69)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtMouse, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(labelImageOrignal)
                            .addComponent(labelImageQuant))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(panelImageOriginal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(panelImageQuantification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(txtMouse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(painelDictionary, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addComponent(painelOP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtTimeExecution, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(labelPsnr1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtCostQuantification, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(labelCostQuantification))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtMse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(labelMse))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtPsnr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(labelPsnr))
                        .addGap(65, 65, 65))))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtMultiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtMultiActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtMultiActionPerformed

    private void panelImageQuantificationMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_panelImageQuantificationMouseMoved
        txtMouse.setText("X: " + String.valueOf(evt.getPoint().getX()) + "    Y: " + String.valueOf(evt.getPoint().getY()));
    }//GEN-LAST:event_panelImageQuantificationMouseMoved

    public void openResultFrame(){
       ResultFrame resultFrame = new ResultFrame();
       resultFrame.setVisible(true);
   }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel bloc1;
    private javax.swing.JLabel labelComp;
    private javax.swing.JLabel labelCostQuantification;
    private javax.swing.JLabel labelDiv;
    private javax.swing.JLabel labelImageOrignal;
    private javax.swing.JLabel labelImageQuant;
    private javax.swing.JLabel labelMse;
    private javax.swing.JLabel labelMulti;
    private javax.swing.JLabel labelPsnr;
    private javax.swing.JLabel labelPsnr1;
    private javax.swing.JLabel labelSub;
    private javax.swing.JLabel labelSum;
    private javax.swing.JPanel painelDictionary;
    private javax.swing.JPanel painelOP;
    private javax.swing.JPanel panelImageOriginal;
    private javax.swing.JPanel panelImageQuantification;
    private javax.swing.JTextField txtComp;
    private javax.swing.JTextField txtCostQuantification;
    private javax.swing.JTextField txtDiv;
    private javax.swing.JTextField txtMouse;
    private javax.swing.JTextField txtMse;
    private javax.swing.JTextField txtMulti;
    private javax.swing.JTextField txtPsnr;
    private javax.swing.JTextField txtSub;
    private javax.swing.JTextField txtSum;
    private javax.swing.JTextField txtTimeExecution;
    // End of variables declaration//GEN-END:variables

}
